#ifndef CPP_NOTIFY_MANAGER_H
#define CPP_NOTIFY_MANAGER_H

#include <Global.h>
#include <string>
#include <vector>

//@brief 通知管理器
//@author cvte
//@description 实现通知分发
class NotifyManager {
   public:
    class OnNotifyListener {
       public:
        virtual void onNotify(int notifyId, void* data) = 0;
    };
    typedef std::vector<OnNotifyListener*> NotifyVector;
    static NotifyManager* getInstance();

    bool containNotify(OnNotifyListener& listener);
    void addNotify(OnNotifyListener& listener);
    void removeNotify(OnNotifyListener& listener);

    void onNotify(int notifyId, void* data);

   protected:
   private:
    NotifyManager();
    virtual ~NotifyManager();
    //活动管理静态实例
    static NotifyManager* sInstance;
    NotifyVector mNotifyVector;
};

#endif /* CPP_NOTIFY_MANAGER_H */